import {request} from "@utils/http"
import type {HospitalSetItem, ReqAddHospitalParams, ReqHospitalSetListParams,ReqHospitalSetListResponse, ReqUpdateHospitalParams} from "./model/hospitalSetTypes"
import React from "react"

/* 
    医院设置列表数据请求
*/
export function reqGetHospitalSetList({page,limit,hoscode,hosname}:ReqHospitalSetListParams){
    return request.get<any,ReqHospitalSetListResponse>(`/admin/hosp/hospitalSet/${page}/${limit}`,{
        //query 参数
        params:{
            hosname:hosname,
            hoscode:hoscode
        }
    });
}


/* 新增医院请求 */
export function reqAddHospital(hospitalSet:ReqAddHospitalParams){
    return request.post<any,null>("/admin/hosp/hospitalSet/save",hospitalSet);
}


// 查看单个医院信息
export function reqGetHospital(id:string){
    return request.get<any,HospitalSetItem>(`/admin/hosp/hospitalSet/get/${id}`);
}

//修改医院信息
export function reqUpdateHospital(hospital:ReqUpdateHospitalParams){
    return request.put<any,null>("/admin/hosp/hospitalSet/update",hospital);
}

//删除单个医院请求
export function reqRemoveHospital(id:number){
    return request.delete<any,null>(`/admin/hosp/hospitalSet/remove/${id}`);
}

export  function reqBatchRemoveHospitalList(hospital:React.Key[]){
    return request.delete<any,null>(`/admin/hosp/hospitalSet/batchRemove`,{
        //query  参数
        // body 请求体
        data:hospital
    }); 
}

  

